<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>管理中心 - 商品列表</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="/Public/Admin/Styles/general.css" rel="stylesheet" type="text/css" />
    <link href="/Public/Admin/Styles/main.css" rel="stylesheet" type="text/css" />
    <link href="/Public/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="/Public/bootstrap/css/docs.min.css" rel="stylesheet">
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="/Public/bootstrap/js/bootstrap.min.js"></script>
</head>
<body>
<h1>
    <?php if($_page_btn_name): ?>
    <span class="action-span"><a href="<?php echo $_page_btn_link; ?>"><?php echo $_page_btn_name; ?></a></span>
    <?php endif; ?>
<span class="action-span1"><a href="<?php echo U('');?>">管理中心</a></span>
<span id="search_id" class="action-span1"> - <?php echo $_page_title; ?> </span>
<div style="clear:both"></div>
</h1>
<div class="main-div">
    <table cellpadding="3" cellspacing="1" class="table table-hover">
        <thead>
        <tr>
            <th>订单号</th>
            <th>商品名称</th>
            <th>商品图片</th>
            <th>商品规格</th>
            <th>商品数量</th>
            <th>商品单价</th>
        </tr>
        </thead>
        <tbody>
        <?php foreach($order['goods_list'] as $k=>$v):?>
        <tr>
            <td><?php echo ($v["order_id"]); ?></td>
            <td><?php echo ($v["goods_name"]); ?></td>
            <td><?php echo showImage($v[sm_logo]);?></td>
            <td>
                <?php foreach($v['gaData'] as $k1=>$v1):?>
                <?php echo ($v1["attr_name"]); ?>:<?php echo ($v1["attr_value"]); ?><br/>
                <?php endforeach?>
            </td>
            <td><?php echo ($v["goods_number"]); ?></td>
            <td><?php echo ($v["price"]); ?></td>
        </tr>
        <?php endforeach;?>
        </tbody>
    </table>

    <table cellspacing="1" cellpadding="3" class="table table-hover">
        <thead>
            <th>收货人</th>
            <th>收货电话</th>
            <th>收货地址</th>
            <th>快递单号</th>
            <th>订单总价</th>
            <th>下单时间</th>
            <th>状态</th>
        </thead>
        <tbody>
        <tr>
            <td><?php echo ($order["shr_name"]); ?></td>
            <td><?php echo ($order["shr_tel"]); ?></td>
            <td>
                <p><?php echo ($order["shr_name"]); ?>[TEL:<?php echo ($order["shr_tel"]); ?>]</p>
                <p><?php echo ($order["shr_province"]); echo ($order["shr_city"]); echo ($order["shr_area"]); echo ($order["address"]); ?></p>
            </td>
            <td><?php echo ($order["post_number"]); ?></td>
            <td>￥<?php echo ($order["total_price"]); ?></td>
            <td><?php echo date('Y-m-d H:i:s' , $v['addtime'])?></td>
            <td>
                <?php if($order['order_status']=='正常'):?>
                <?php if($order['pay_status']=='是'):?>
                <?php echo $order['post_status'] == 1 ? '已发货':($order['post_status'] == 2 ?'已签收':'未发货'); ?>
                <?php else:?>
                  <?php echo makeAlipayBtn($order['id'])?>
                <?php endif;?>
                <?php else:?>
                已取消
                <?php endif;?>
            </td>
        </tr>
        </tbody>
    </table>
    <form name="main_form" method="POST" action="/index.php/Admin/Order/edit/order_id/3/p/1.html" enctype="multipart/form-data">
        <table cellspacing="1" cellpadding="3" width="100%">
            <tr>
                <td class="label">
                    订单状态:
                </td>
                <td>
                    <select <?php if($order['order_status'] =='关闭'):?>disabled<?php endif;?> name="order_status" class="form-control">
                            <option<?php if($order['order_status'] =='正常'):?> selected <?php endif;?> value="正常">正常</option>
                             <option<?php if($order['order_status'] =='关闭'):?> selected <?php endif;?> value="关闭">关闭</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td class="label">
                    支付状态
                </td>
                <td>
                    <input disabled value="<?php echo $order['pay_status'] == '是' ? '已支付':'未支付';?>"/>
                </td>
            </tr>
            <tr>
                <td class="label">
                    发货状态:
                </td>
                <td>
                    <select <?php if($order['post_status'] ==2):?> disabled <?php endif;?> name="post_status" class="form-control" >
                    <option <?php if($order['post_status']==0):?> selected <?php endif;?> value="0">未发货</option>
                    <option <?php if($order['post_status']==1):?> selected <?php endif;?> value="1">已发货</option>
                    <option <?php if($order['post_status']==2):?> selected <?php endif;?> value="2">已签收</option>
                        </select>
                </td>
            </tr>
            <tr>
                <td class="label">
                    快递单号
                </td>
                <td>
                    <input <?php if($order['post_status'] ==2):?> disabled <?php endif?> name="post_number" value="<?php echo ($order["post_number"]); ?>"
                    type="text" class="form-control" placeholder="请输入快递单号"/>
                </td>
            </tr>
            <?php if($order['post_status']==2):?>
            <tr colspan="2">
                <td  colspan="99" align="center">
                    <span style="font-size:30px;color:skyblue">该订单已经完成!</span>
                </td>
            </tr>
            <?php else:?>
            <tr>
                <td class="label">
                </td>
                <td colspan="99">
                    <input type="submit"  value="确定">
                    <input type="hidden" name="id" value="<?php echo ($order["id"]); ?>">
                </td>
            </tr>
            <?php endif;?>
            </table>
        </form>
</div>
<div id="footer">
    共执行 9 个查询，用时 0.025161 秒，Gzip 已禁用，内存占用 3.258 MB<br />
    版权所有 &copy; 2005-2012 上海商派网络科技有限公司，并保留所有权利。
</div>
</body>
</html>